package com.yanyeori.framework.redis.listener;

import com.yanyeori.framework.core.util.SpringUtil;
import com.yanyeori.framework.redis.constant.RedisConst;
import com.yanyeori.framework.redis.model.RemoteEvent;

/**
 * 远程事件监听
 *
 * @author chenkuan 2020/08/20
 */
public class RemoteEventListener extends RedisListener<RemoteEvent> {

    public RemoteEventListener() {
        super(RedisConst.TOPIC_REDIS_EVENT_REMOTE_PUBLISH);
    }

    @Override
    protected void receive(RemoteEvent message) {
        SpringUtil.publishEvent(message.getEvent());
    }
}
